import request from '@/utils/request'

export const fetchBookOrder = params => {
  return request({
    url: '/book-orders',
    params
  })
}

export const updateBookOrder = (data, id) => {
  return request({
    url: `/book-orders/${id}`,
    method: 'put',
    data
  })
}

export const fetchOrderStatistics = params => {
  return request({
    url: '/order-statistics',
    params
  })
}
export const checkOrders = code => {
  return request({
    url: '/check-order',
    params: {
      code: code
    }
  })
}

export const fetchOrderReviews = params => {
  return request({
    url: '/order-reviews',
    params
  })
}

export const reviewOrder = (data, id) => {
  return request({
    url: `/order-reviews/${id}`,
    method: 'put',
    data
  })
}
export const fetchMealStatistics = params => {
  return request({
    url: '/meal-statistics',
    params
  })
}
